package cn.bonoon.kernel.menus.tips;

import cn.bonoon.kernel.menus.PlatformContext;

public enum MenuTipType {
	CLASS {
		@Override
		public MenuTipHandler resolve(PlatformContext platformContext, String value) throws Exception {
			return (MenuTipHandler) Class.forName(value).newInstance();
		}
	},
	BEAN {
		@Override
		public MenuTipHandler resolve(PlatformContext platformContext, String value) throws Exception {
			return platformContext.bean(value, MenuTipHandler.class);
		}
	},
	SQL {
		@Override
		public MenuTipHandler resolve(PlatformContext platformContext, String value) throws Exception {
			return new SqlMenuTipHandler(value);
		}
	},
	HQL {
		@Override
		public MenuTipHandler resolve(PlatformContext platformContext, String value) throws Exception {
			return new HqlMenuTipHandler(value);
		}
	};
	
	public abstract MenuTipHandler resolve(PlatformContext platformContext, String value) throws Exception;
}
